<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE6">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="Author" content="">
		<meta name="Keywords" content="">
		<meta name="Description" content="">
		<link rel="stylesheet" type="text/css" href="<%=basePath%>css/all_b.css?20161126">
		<title>新增会员</title>
		<script type="text/javascript" src="<%=basePath%>js/jquery.min.js?20161126"></script>
		<script type="text/javascript" src="<%=basePath%>js/layer/layer.js?20161126"></script>
	</head>
	<body countdown="" style="" id="bodyModule">
		<jsp:include page="commons/manage_head.jsp" flush="true"></jsp:include>
		<div style="height: 456px;" id="layout" class="container">
			<div style="display: none;" dom="left" class="sidebar">
				<div id="account_nav">
					<div class="box account_nav">
						<h3 class="blue-title">
							<span>账号管理</span><em>数量</em>
						</h3>
						<ul id="nav" class="left_nav">
							<li class="" level="0">
								管理员
								<em id="accounts0">2</em>
							</li>
							<li class="on" level="1">
								分公司
								<em id="accounts1">4</em>
							</li>
							<li level="2">
								股东
								<em id="accounts2">4</em>
							</li>
							<li level="3">
								总代理
								<em id="accounts3">4</em>
							</li>
							<li level="4">
								代理
								<em id="accounts4">4</em>
							</li>
							<li level="5">
								会员
								<em id="accounts5">7</em>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<div style="display: block;" id="rightLoader" dom="right"
				class="main-content bet-content">
				<div id="dagudong" class=" member">
					<div class="title">
						<span id="account_name">新增会员</span>
						<a href="javascript:history.go(-1)" id="reback" level="1"
							class="mag-btn1">返回</a>
					</div>
					<form class="ant-form-horizontal"
						action="<%=basePath%>user/add_user" method="post">
						<div id="user_info">
							<table class="clear-table base-info">
								<caption>
									<div>
										新增会员
									</div>
								</caption>
								<tbody>
									<tr>
										<th>
											登录帐号
										</th>
										<td>
											<input name="userNo" type="text" maxlength="20"/>
											<span class="g-vd-status g-vd-s-error"></span>
										</td>
										<th>
											名称
										</th>
										<td>
											<input name="userName" type="text">
											<span class="g-vd-status"></span>
										</td>
										<th>
											密码
										</th>
										<td>
											<input name="password" type="password" maxlength="18"/>
											<span class="g-vd-status"></span>
										</td>
									</tr>
									<tr>
										<th>
											用户类型
										</th>
										<td>
											<c:if test="${sessionUser.roleId == 1 }">
											<label for="corpRptFlag2">
												<input id="corpRptFlag2" name="roleId" type="radio" value="2" />代理用户
											</label>
											</c:if>
											<c:if test="${sessionUser.roleId == 2}">
												<label for="corpRptFlag1"><input id="corpRptFlag1" name="roleId" type="radio" value="3" />会员用户</label>
											</c:if>
										</td>
										<th>
										</th>
										<td>
										</td>
										<th>
										</th>
										<td>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="btn-line">
							<a type="button" class="yellow-btn" id="submit"
								href="javascript:void(0)" onclick="addUser()">确定</a>
							<a type="reset" class="white-btn" id="reset"
								href="javascript:void(0)">取 消</a>
						</div>
					</form>
				</div>
			</div>
		</div>
		<!--[if lte IE 6.5]><![endif]-->
		<div class="footer">
			<div class="marquee">
				<a id="moreNotice" class="more more_announcement"
					href="javascript:void(0)">更多</a>
				<p class="marqueeBox">
					<marquee id="marqueeBox" scrollamount="2">
						欢迎光临...........
					</marquee>
				</p>
			</div>
			<span id="marqueeRefresh" class="hidden">10</span>
			<span id="kefuRefresh" class="hidden"></span>
		</div>
		<script src="<%=basePath%>js/jquery.min.js?20161104"></script>
	</body>
	<script type="text/javascript">
	function addUser(){
		var userNo = $("input[name=userNo]").val();
		var roleId = $("input[name=roleId]:checked").val();
		var password = $("input[name=password]").val();
		if(userNo.trim() == ''){
			layer.msg("账户不能为空");
			return;
		}
		if(password.trim() == ''){
			layer.msg("密码不能为空");
			return;
		}
		if(roleId == '' || roleId == undefined){
			layer.msg("帐户类型不能为空");
			return;
		}
		$.ajax({
            type: "POST",
            url:$("form").attr("action"),
            data:$("form").serialize(),// 你的formid
            error: function(request) {
                layer.msg("连接错误");
            },
            success: function(data) {
               layer.msg(data.msg);
               window.location.reload();//刷新
            }
        });
	}
</script>
</html>